package banco.servicos;

import javax.ejb.EJB;
import javax.ejb.Stateless;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;

import banco.facade.FachadaBanco;

@Path("/saldo")
@Stateless
public class Saldo {
	@EJB
	private FachadaBanco fachadaBanco;
	
	@GET
	@Produces(MediaType.APPLICATION_JSON)
	public String saldo(@QueryParam("login") String login, @QueryParam("senha") String senha) {
		return String.valueOf(fachadaBanco.autenticar(login, senha).getConta().getSaldo());
	}
}
